home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5667 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: writing to .exe file
  5. Date: 20 Feb 1996 10:36:40 GMT
  6. Organization: systems hk
  7. Message-ID: <4gc87o$dm7@maureen.teleport.com>
  8. References: <4g961o$gdr@ultra.sonic.net>
  9. NNTP-Posting-Host: ip-pdx04-22.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. Ted Rollheiser <trollhei@sonic.net> wrote:
  16. >I would like  to save data ( a string ) from one run of a (dos) program 
  17. >to the next by writing it to the .exe file. does this sound doable?
  18. >
  19. Ted,
  20.  
  21. I haven't done it in a long time, but you should be able to do it.
  22. You probably need to put a 'magic number' in the executable in front
  23. a data area that you know will be there (like a literal string in front
  24. of your string area, within a structure), and that your updating program
  25. can locate while scanning the executable. Stuff a new string into the
  26. string area, assuming you know where the string area is in relation to the
  27. magic number.
  28. Yours, Geoff Houck
  29.  
  30.